//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "canlib\\canlib.h"
//---------------------------------------------------------------------------
struct TWMCanLib
{
    Cardinal Msg;
    DWORD hnd;
    WORD event;
    WORD _pad;
    Longint Result;
};

typedef struct _canstruct
{
   unsigned int id;
   unsigned int dlc;
   unsigned char data[8];
}CanMessage;

int Handle1, Handle2;
int stat;
long id;
unsigned char RxData[8];
unsigned int dlc, flags;
unsigned long timestamp;
unsigned long cantimer;

class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TRadioGroup *RadioGroup1;
        TRadioGroup *RadioGroup4;
        TRadioGroup *RadioGroup2;
        TRadioGroup *RadioGroup3;
        TMemo *Memo1;
        TButton *Button1;
        TButton *LDM1;
        TButton *LDM2;
        TButton *LDM3;
        TButton *LDM11;
        TTimer *Timer1;
        TGroupBox *LM;
        TButton *RDM1;
        TButton *RDM2;
        TButton *RDM3;
        TButton *RDM11;
        TGroupBox *RM;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall LDM1Click(TObject *Sender);
        void __fastcall LDM2Click(TObject *Sender);
        void __fastcall LDM3Click(TObject *Sender);
        void __fastcall LDM11Click(TObject *Sender);
        void __fastcall RDM1Click(TObject *Sender);
        void __fastcall RDM2Click(TObject *Sender);
        void __fastcall RDM3Click(TObject *Sender);
        void __fastcall RDM11Click(TObject *Sender);
       

//---------------------------------------------------------------------------
protected:
    void __fastcall WMCanLib(TWMCanLib& Message);


    BEGIN_MESSAGE_MAP
        MESSAGE_HANDLER(WM__CANLIB/*17378*/, TWMCanLib, WMCanLib); //WM_USER
    END_MESSAGE_MAP(TForm)
//---------------------------------------------------------------------------
private:	// User declarations
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
